package com.example.test01;
import androidx.appcompat.app.AppCompatActivity;


import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;

import androidx.fragment.app.FragmentTabHost;

import com.example.test01.fragment.FragmentA1;
import com.example.test01.fragment.FragmentA2;

public class FragActivity extends MainActivity {
    private FragmentTabHost mTabHost;
    Button but1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_test);
        but1 = (Button) findViewById(R.id.send);
        mTabHost = (FragmentTabHost) findViewById(android.R.id.tabhost);
        mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent);
        mTabHost.addTab(mTabHost.newTabSpec(""). setIndicator("首页"), FragmentA1.class, null);
        mTabHost.addTab(mTabHost.newTabSpec("").setIndicator("个人中心"), FragmentA2.class, null);
    }
}